<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>IIET Student Information Form</title>


<script type="text/javascript" src="jquery.js"></script>

<script >
	var councelling_fee = '<c:out value="${fees['councelling']}" ></c:out>';
	var reimbursement_fee = '<c:out value="${fees['reimbursement']}" ></c:out>';
	var management_fee = '<c:out value="${fees['management']}" ></c:out>';
	var bus_fee = '<c:out value="${fees['bus']}" ></c:out>';
	var admission_fee = '<c:out value="${fees['admission']}" ></c:out>';
	var hostel_fee = '<c:out value="${fees['hostel']}" ></c:out>';
	
</script>
</head>

<body onload="setFees();">

<script type="text/javascript">

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function setFees() {
	$("#tution_fee").val(reimbursement_fee);
	$("#admission_fee").val(admission_fee);
	$("#hostel_fee").val('0');
	$("#transportation_fee").val('0');
	//$("#total_fee").val('0');
	setTotalFee();

}

function setTutionFee(){
	//alert("TF: " + $("tution_fee").value);
	if($("#category").val() =='councelling') {
		$("#tution_fee").val(councelling_fee);
	}
	else if($("#category").val() =='reimbursement') {
		$("#tution_fee").val(reimbursement_fee);
	}
	else if($("#category").val() =='management') {
		$("#tution_fee").val(management_fee);
	}
	setTotalFee();
}
function setHostelFee(){
	//alert("TF: " + $("#tution_fee").value);
	
	if($("#hostel").val() =='yes') {
		$("#hostel_fee").val(hostel_fee);
	}else {
		$("#hostel_fee").val('0');
	}
	setTotalFee();
}
function setBusFee(){
	//alert("TF: " + $("#tution_fee").value);
	if($("#bus").val() =='yes') {
		
		$("#transportation_fee").val(bus_fee);
		
	}else {
		$("#transportation_fee").val('0');
	}
	setTotalFee();
}
function setTotalFee(){
	//alert("TF: " + $("#tution_fee").value);
	
	
		
	$("#total_fee").val(parseInt($("#tution_fee").val()) + parseInt($("#admission_fee").val()) + parseInt($("#transportation_fee").val()) + parseInt($("#hostel_fee").val()));
	
	
}

function fillZero() {
	if($("#tution_fee").val()=="")
		$("#tution_fee").val('0');
	if($("#admission_fee").val()=="")
		$("#admission_fee").val('0');
	if($("#transportation_fee").val()=="")
		$("#transportation_fee").val('0');
	if($("#hostel_fee").val()=="") {
		$("#hostel_fee").val('0');
		//$("#hostel").selectedIndex = ;
	}
	setTotalFee();
}
</script>

<form id="form1" name="form1" method="post" action="savestudent.htm" >
  <div align="center">
    <h2> Student Information Form</h2>
    <table width="300" border="1" cellpadding="5" >
      <tr>
        <td valign="top" scope="row"><table width="289" border="0" cellpadding="5">
         <caption>
          <strong>Academic Information</strong>
          </caption>
          <tr>
            <td width="113" align="right" scope="row">HallTicket No:</td>
            <td width="150" align="left"><label>
              <input type="text" name="htno" id="htno" />
            </label></td>
          </tr>
          <tr>
            <td align="right" scope="row">Name:</td>
            <td align="left"><input type="text" name="name" id="name" /></td>
          </tr>
          <tr>
            <td align="right" scope="row">Branch:</td>
            <td align="left"><input type="text" name="branch" id="branch" /></td>
          </tr>
          <tr>
            <td align="right" scope="row">Course:</td>
            <td align="left"><select name="course" id="course" onchange="">
                <option value="B.Tech" selected="selected">B.Tech</option>
                <option value="M.B.A">M.B.A</option>
                <option value="M.C.A">M.C.A</option>
                <option value="M.Tech">M.Tech</option>
                <option value="Diploma">Diploma</option>
                <option value="B.Ed">B.Ed</option>
            </select></td>
          </tr>
          <tr>
            <td align="right" scope="row">Year of Study:</td>
            <td align="left"><select name="year" id="year" onchange="">
              <option value="I">I Year</option>
              <option value="II">II Year</option>
              <option value="III">III Year</option>
              <option value="IV">IV Year</option>
            </select></td>
          </tr>
          <tr>
            <td align="right" scope="row">Stays in Hostel:</td>
            <td align="left"><select name="hostel" id="hostel" onchange="setHostelFee();">
              <option value="yes">yes</option>
              <option value="no" selected="selected">no</option>
                        </select></td>
          </tr>
          <tr>
            <td align="right" scope="row">College Bus:</td>
            <td align="left"><select name="bus" id="bus" onchange="setBusFee();">
              <option value="yes">yes</option>
              <option value="no" selected="selected">no</option>
                        </select></td>
          </tr>
        </table></td>
        <td valign="top"><table width="291" border="0" align="right" cellpadding="5">
          <caption>
          <strong>Accounts Information</strong>
          </caption>
          <tr>
            <td width="121" align="right" scope="row">Category:</td>
            <td width="144"><select name="category" id="category" onchange="setTutionFee();">
                <option value="councelling">Councelling</option>
                <option value="management">Management</option>
                <option value="reimbursement" selected="selected">Reimbursement</option>
            </select></td>
          </tr>
          <tr>
            <td align="right" scope="row">Tution Fee:</td>
            <td><label>
              <input type="text" name="tution_fee" id="tution_fee" onkeyup="fillZero();"/>
            </label></td>
          </tr>
          <tr>
            <td align="right" scope="row">Admission Fee:</td>
            <td><input type="text" name="admission_fee" id="admission_fee" onkeyup="fillZero();"/></td>
          </tr>
          <tr>
            <td align="right" scope="row">Hostel Fee:</td>
            <td><input type="text" name="hostel_fee" id="hostel_fee" onkeyup="fillZero();"/></td>
          </tr>
          <tr>
            <td align="right" scope="row">Transportation Fee:</td>
            <td><input type="text" name="transportation_fee" id="transportation_fee" onkeyup="fillZero();"/></td>
          </tr>
          <tr>
            <td align="right" scope="row">Total Fee:</td>
            <td><input type="text" name="total_fee" id="total_fee" /></td>
          </tr>
        </table></td>
        <td valign="top"><table width="300" border="0" align="left" cellpadding="5">
          <caption>
          <strong>Personal Information </strong>
          </caption>
          <tr>
            <td align="right" scope="row">Father Name:</td>
            <td><label>
              <input type="text" name="father_name" id="father_name" />
            </label></td>
          </tr>
          <tr>
            <td align="right" scope="row">Mobile:</td>
            <td><input type="text" name="mobile" id="mobile" /></td>
          </tr>
          <tr>
            <td align="right" scope="row">e-Mail:</td>
            <td><input type="text" name="email" id="email" /></td>
          </tr>
          <tr>
            <td align="right" scope="row">Parent Mobile1:</td>
            <td><input type="text" name="parent_mobile1" id="parent_mobile1" /></td>
          </tr>
          <tr>
            <td align="right" scope="row">Parent Mobile2:</td>
            <td><input type="text" name="parent_mobile2" id="parent_mobile2" /></td>
          </tr>
          <tr>
            <td align="right" scope="row">address:</td>
            <td><label>
              <textarea name="address" id="address" cols="20" rows="5"></textarea>
            </label></td>
          </tr>
        </table></td>
      </tr>
      <tr valign="top">
        <td colspan="3" align="center" scope="row"><label>
          <input type="submit" name="Save" id="Save" value="Save Student Information" />
        </label></td>
      </tr>
    </table>
    <p>&nbsp;  </p>
  </div>
</form>
</body>
</html>
